package com.beiji.lib.pen

import android.content.Context
import android.util.DisplayMetrics
import android.widget.Toast

fun Context.toast(messageId: Int) {
    Toast.makeText(this, messageId, Toast.LENGTH_SHORT).show()
}

fun Context.toast(message: String) {
    Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
}

inline val Context.displayMetrics: DisplayMetrics
    get() = this.resources.displayMetrics

inline val Context.screenWidth: Int
    get() = this.displayMetrics.widthPixels

inline val Context.screenHeight: Int
    get() = this.displayMetrics.heightPixels

inline val Context.screenDensity: Float
    get() = this.displayMetrics.density